<?php

namespace module\index\validate;

use app\Validate;

class Teacher extends Validate
{
    /**
     * 所有验证场景需要的字段.
     *
     * @var array<array>
     */
    protected $scene = [
        'save' => ['name', 'avatar', 'dist_id'],
        'index' => ['page', 'pageSize'],
    ];
    /**
     * Get the validation rules that apply to the request.
     *
     * @var array<string>
     */
    protected $rule = [
        'id' => 'require|integer|max:10',
        'name' => 'requireWithout:id|max:60',  // 姓名
        'avatar' => 'requireWithout:id|max:60',  //         'avatar' => '身份证正面照片',  // 图标
        'dist_id' => 'requireWithout:id|max:60',  // 地区
        'status' => 'in:1,2',  // 状态
        'page' => 'integer|>:0',
        'pageSize' => 'integer|>:0',
    ];
    /**
     * 验证字段描述
     * 
     * @var array<string>
     */
    protected $field = [
        'name' => '名称',  // 姓名
        'avatar' => '图标',  // 图标
        'dist_id' => '地区',  // 地区
        'status' => '状态',  // 状态
        'page' => '页码',
        'pageSize' => '分页大小',
    ];
}
